﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Xml;

namespace AREQWinService
{
    [Serializable]
    [XmlRoot("FSM_BROADCAST")]
    public class FSM_BROADCAST
    {
        
        [XmlElement("HEADER")]
        public HEADER Header;
        [XmlArray("CURRENT_PROGRAMS")]
        [XmlArrayItem("CTL_ELEM")]
        public CTL_ELEM[] ControlElements;
        [XmlArray("CURRENT_FEAS_FCAS")]
        [XmlArrayItem("FCA")]
        public FCA[] FCAs;
    }
    [Serializable]
    public class HEADER
    {
        string filename;
        string updatetime;
        string hubsite;

        [XmlElement("FILE_NAME")]
        public string Filename
        {
            get { return filename; }
            set { filename = value; }
        }
        [XmlElement("UPDATE_TIME")]
        public string UpdateTime
        {
            get { return updatetime; }
            set { updatetime = value; }
        }
        [XmlElement("HUB_SITE")]
        public string HubSite
        {
            get { return hubsite; }
            set { hubsite = value; }
        }
    }
    [Serializable]
    public class CTL_ELEM
    {
        string elemname;
        string elemtype;
        string issued;
        string lastmodified;
        string cumstart;
        string cumend;

        [XmlElement("ELEM_NAME")]
        public string ElemName
        {
            get { return elemname; }
            set { elemname = value; }
        }
        [XmlElement("ELEM_TYPE")]
        public string ElemType
        {
            get { return elemtype; }
            set { elemtype = value; }
        }
        [XmlElement("ISSUED")]
        public string Issued
        {
            get { return issued; }
            set { issued = value; }
        }
        [XmlElement("LAST_MODIFIED")]
        public string LastModified
        {
            get { return lastmodified; }
            set { lastmodified = value; }
        }
        [XmlElement("CUM_START")]
        public string CumStart
        {
            get { return cumstart; }
            set { cumstart = value; }
        }
        [XmlElement("CUM_END")]
        public string CumEnd
        {
            get { return cumend; }
            set { cumend = value; }
        }

        [XmlElement("PROGRAM")]
        public PROGRAM[] Programs;
    }
    [Serializable]
    public class PROGRAM
    {
        string programtype;
        string programstart;
        string programend;
        string programstatus;

        [XmlElement("PROG_TYPE")]
        public string ProgramType
        {
            get { return programtype; }
            set { programtype = value; }
        }
        [XmlElement("PROG_START")]
        public string ProgramStart
        {
            get { return programstart; }
            set { programstart = value; }
        }
        [XmlElement("PROG_END")]
        public string ProgramEnd
        {
            get { return programend; }
            set { programend = value; }
        }
        [XmlElement("PROG_STATUS")]
        public string ProgramStatus
        {
            get { return programstatus; }
            set { programstatus = value; }
        }
    }
    [Serializable]
    public class FCA
    {
        string fcaid;
        string name;
        string domain;
        string lastupdate;
        string upwkstn;
        string upsite;
        string crwkstn;
        string crsite;
        string reason;
        string type;
        string colorid;
        string start;
        string end;
        string fsmeligible;
        string extended;
        string lookahead;

        [XmlElement("FCA_ID")]
        public string FcaID
        {
            get { return fcaid; }
            set { fcaid = value; }
        }
        [XmlElement("NAME")]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        [XmlElement("DOMAIN")]
        public string Domain
        {
            get { return domain; }
            set { domain = value; }
        }
        [XmlElement("LASTUPDATE")]
        public string LastUpdate
        {
            get { return lastupdate; }
            set { lastupdate = value; }
        }
        [XmlElement("UP_WKSTN")]
        public string UpWkstn
        {
            get { return upwkstn; }
            set { upwkstn = value; }
        }
        [XmlElement("UP_SITE")]
        public string UpSite
        {
            get { return upsite; }
            set { upsite = value; }
        }
        [XmlElement("CR_WKSTN")]
        public string CrWkstn
        {
            get { return crwkstn; }
            set { crwkstn = value; }
        }
        [XmlElement("CR_SITE")]
        public string CrSite
        {
            get { return crsite; }
            set { crsite = value; }
        }
        [XmlElement("REASON")]
        public string Reason
        {
            get { return reason; }
            set { reason = value; }
        }
        [XmlElement("TYPE")]
        public string Type
        {
            get { return type; }
            set { type = value; }
        }
        [XmlElement("COLOR_ID")]
        public string ColorID
        {
            get { return colorid; }
            set { colorid = value; }
        }
        [XmlElement("START")]
        public string Start
        {
            get { return start; }
            set { start = value; }
        }
        [XmlElement("END")]
        public string End   
        {
            get { return end; }
            set { end = value; }
        }
        [XmlElement("FSM_ELIGIBLE")]
        public string FsmEligible
        {
            get { return fsmeligible; }
            set { fsmeligible = value; }
        }
        [XmlElement("EXTENDED")]
        public string Extended
        {
            get { return extended; }
            set { extended = value; }
        }
        [XmlElement("LOOK_AHEAD")]
        public string LookAhead
        {
            get { return lookahead; }
            set { lookahead = value; }
        }

        [XmlElement("POLYGON")]
        public POLYGON[] Polygons;

        //Need Primary Filiter Array details
    }
    [Serializable]
    public class POLYGON
    {
        string ceiling;
        string floor;
        string direction;
        string speed;
        string drawing;
        string points;
        [XmlElement("CEILING")]
        public string Ceiling
        {
            get { return ceiling; }
            set { ceiling = value; }
        }
        [XmlElement("FLOOR")]
        public string Floor
        {
            get { return floor; }
            set { floor = value; }
        }
        [XmlElement("DIRECTION")]
        public string Direction
        {
            get { return direction; }
            set { direction = value; }
        }
        [XmlElement("SPEED")]
        public string Speed
        {
            get { return speed; }
            set { speed = value; }
        }
        [XmlElement("DRAWING")]
        public string Drawing
        {
            get { return drawing; }
            set { drawing = value; }
        }
        [XmlElement("POINTS")]
        public string Points
        {
            get { return points; }
            set { points = value; }
        }
    }
}
